#.libPaths("/home/m081429/R/x86_64-unknown-linux-gnu-library/2.15")
# source("http://bioconductor.org/biocLite.R")
#    biocLite("CNTools")
library(CNTools)
#setwd("/data4/bsi/bioinf_ext1/s113861.chrX/TCGA_DATA/CNV")
sampleData<-read.table("selected.txt",sep="\t",head=T)
#seg <- CNSeg(sampleData[which(is.element(sampleData[, "ID"],sample(unique(sampleData[, "ID"]), 10))), ])
seg <- CNSeg(sampleData)
#rdseg <- getRS(seg, by = "region", imput = FALSE, XY = FALSE, what = "mean")
data("geneInfo")
rdByGene <- getRS(seg, by = "gene", imput = FALSE, XY = FALSE, geneMap = geneInfo,what = "mean")
reducedseg <- rs(rdseg)
